www.mxdraw.com
内容索引主面
前一个向上下一个
IMxDrawEntity::GetBoundingBox 方法

返回实体的最小矩形框外包

IDL
[helpstring("method GetBoundingBox")]
HRESULT GetBoundingBox([out] IMxDrawPoint** minPoint, [out] IMxDrawPoint** maxPoint);
参数 
说明 
[out] IMxDrawPoint** minPoint 
外包框的左下角点 
[out] IMxDrawPoint** maxPoint 
外包框的右上角点 

例如: VB.net代码

        Dim mxUtility As MxDrawXLib.MxDrawUtility
        mxUtility = New MxDrawXLib.MxDrawUtility


        Dim ent As MxDrawXLib.MxDrawEntity
        ent = mxUtility.GetEntity(Nothing, Chr(13) + Chr(10) + "选择对象:")

        If (ent Is Nothing) Then
            Exit Sub
        End If

        Dim minPt As MxDrawXLib.MxDrawPoint
        Dim maxPt As MxDrawXLib.MxDrawPoint
        ent.GetBoundingBox(minPt, maxPt)

        If (minPt Is Nothing) Then
            Exit Sub
        End If


        // 求出选择对象的中心点
        Dim dX, dY As Double

        dX = minPt.x + (maxPt.x - minPt.x) / 2.0
        dY = minPt.y + (maxPt.y - minPt.y) / 2.0
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!